import Cookies from 'js-cookie';

export function getToken() {
	// console.info('auth',Cookies.get('token'));
	// if (Cookies.get('token') && !localStorage.getItem('token')) {
	// 	localStorage.setItem('token', Cookies.get('token'));
	// }
	if (Cookies.get('token')) {
		return Cookies.get('token');
	}
	if (localStorage.getItem('token')) {
		return localStorage.getItem('token');
	}
	return null;
}

export function setToken(token) {
	return localStorage.setItem('token', token);
}

export function removeToken() {
	return localStorage.removeItem('token');
}
